package com.hilinos.common.util;

import com.hilinos.common.common.ReturnCode;

import java.util.Map;

/**
 * @author qhl
 */
public class LicenseUtils {

    public static synchronized void checkLicense(String license) {
        Map map = JwtUtils.check(license, Map.class);
        AssertUtils.isNotEmpty(map, ReturnCode.AUTH_LICENSE_ERROR);
        AssertUtils.isNotEmpty(map.get("key"), ReturnCode.AUTH_LICENSE_ERROR);
        AssertUtils.isRex("HILINOS_FTP".equalsIgnoreCase(map.get("key") + ""), ReturnCode.AUTH_LICENSE_ERROR);
    }

}
